﻿using DevExpress.Web.ASPxEditors;
using DevExpress.Web.ASPxGridView;
using Kaysite.Controller;
using Kaysite.Model;

public partial class Controls_AdminControls_OfficeList : BaseListControl<OfficeController, Office>
{
    public override ASPxGridView GridView
    {
        get { return gridList; }
    }

    public override ASPxButton AddButton
    {
        get { return btnAdd; }
    }

    public override string GetEditPopupTitle(bool isEdit = false)
    {
        return "офіс";
    }

    protected override void gvItems_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e)
    {
        base.gvItems_HtmlRowCreated(sender, e);
        if (e.RowType == GridViewRowType.Data)
        {
            GridButton_SetEventClick(e.VisibleIndex, "btnMap",
                string.Format("window.location = '{0}?view=OfficeLocationEdit&ID={1}';", Request.Path, e.KeyValue));
        }
    }
}